<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('非银行第三方支付机构（拿到支付许可证的）列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="grid">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>机构名称：</label>
                                <input type="text" name="name"/>
                            </li>
                            <li>
                                <label>许可证号：</label>
                                <input type="text" name="warrantNo"/>
                            </li>
                            <li>
                                <label>注册地：</label>
                                <input type="text" name="registrationArea"/>
                            </li>
                            <li>
                                <label>经营范围：</label>
                                <select class="form-control" name="scopeRemark">
                                    <option value = "">全部</option>
                                    <option value = "互联网支付">互联网支付</option>
                                    <option value = "银行卡收单">银行卡收单</option>
                                    <option value = "预付卡受理">预付卡仅受理</option>
                                    <option value = "预付卡发行与受理">预付卡发行与受理</option>
                                    <option value = "数字电视支付">数字电视支付</option>
                                    <option value = "移动电话支付">移动电话支付</option>
                                    <option value = "固定电话支付">固定电话支付</option>
                                </select>
                            </li>
                           <!-- <li>
                                <label>失效日期：</label>
                                <input type="text" class="time-input" placeholder="请选择失效日期" name="expirationDate"/>
                            </li>-->
<!--                            <li>
                                <label>首次许可日期：</label>
                                <input type="text" class="time-input" placeholder="请选择首次许可日期" name="firstCreateDate"/>
                            </li>-->
                            <!--<li>
                                <label>最后变更日期：</label>
                                <input type="text" class="time-input" placeholder="请选择最近变更日期" name="lastUpdateDate"/>
                            </li>-->

                            <li>
                                <label>状态：</label>
                                <select class="form-control" name="state">
                                    <option value = "">全部</option>
                                    <option value = "0">正常</option>
                                    <option value = "1">注销</option>
                                </select>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="business:agency:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="business:agency:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <!--<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="business:agency:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>-->
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="business:agency:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('business:agency:edit')}]];
        var removeFlag = [[${@permission.hasPermi('business:agency:remove')}]];
        var prefix = ctx + "business/agency";

        $(function() {
            // 获取数据字典数据
            var company_states = [[${@dict.getType('bus_company_normal_cancelled')}]];
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "非银行第三方支付机构",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'id',
                    title: '主键id',
                    visible: false
                },
                {
                    field: 'warrantNo',
                    title: '支付许可证编号'
                },
                {
                    field: 'name',
                    title: '机构名称',
                    formatter: function(value, row, index) {
                        // return "<a href = '" + row.pbcUrl + "' tagert='_blank' tilte = '" + row.pbcUrl + "'>" + value + "</a>";
                        return "<a href = '" + row.pbcUrl + "'>" + value + "</a>";
                    }
                },
                {
                    field: 'who',
                    title: '负责人'
                },
                {
                    field: 'registrationArea',
                    title: '注册所在地'
                },
                {
                    field: 'scopeRemark',
                    title: '经营范围说明',
                    width: '350',
                },
                {
                    field: 'expirationDate',
                    title: '失效日期'
                },
                /*{
                    field: 'firstCreateDate',
                    title: '首次许可日期'
                },*/
                {
                    field: 'lastUpdateDate',
                    title: '最近变更日期'
                },
                {
                    field: 'state',
                    title: '状态',
                    // 格式化数据字典
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(company_states, value);
                    }
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        // actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>